package com.aaa.mrcai.controller;

import com.aaa.mrcai.annotion.AAALog;
import com.aaa.mrcai.pojo.vo.SendVO;
import com.aaa.mrcai.query.SendQuery;
import com.aaa.mrcai.result.AjaxResult;
import com.aaa.mrcai.service.SendService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author meowyf
 * @version 1.0
 * @Name Z_MJ
 * @date 2021/12/13 16:39:08
 */
@RestController
@RequestMapping("send")
public class SendController {
    @Autowired
    private SendService sendService;

    @RequestMapping("list")
    public AjaxResult list(SendQuery sendQuery){
        return sendService.list(sendQuery);
    }

    @RequestMapping("/listScontend/{id}")
    public AjaxResult listScontend(@PathVariable int id){
        return sendService.listScontend(id);
    }

    @RequestMapping("listRole")
    public AjaxResult listRole(){
        return sendService.listRole();
    }

    @RequestMapping("/deleteSend/{id}")
    @AAALog("删除公告")
    public AjaxResult deleteSend(@PathVariable int id){
        return sendService.deleteSend(id);
    }

    @RequestMapping("addNotify")
    @AAALog("添加公告")
    public AjaxResult addNotify(SendVO sendVO){
        System.out.println("[[[[[[[[[[[[[[[["+sendVO);
        return sendService.addNotify(sendVO);
    }
}
